Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[onnxruntime] Update to 1.18.0 #215

Merged
merged 10 commits into from
Jun 29, 2024
Merged

[onnxruntime] Update to 1.18.0 #215

merged 10 commits into from
Jun 29, 2024

Conversation

luncliff
Copy link
Owner

Changes

Rework https://github.com/microsoft/onnxruntime port without features

References

Triplet Support

  • x64-windows
  • x64-linux
  • x64-osx

Configuration

"vcpkg-configuration.json" changes for the release.

{
    "registries": [
        {
            "kind": "git",
            "repository": "https://github.com/luncliff/vcpkg-registry",
            "packages": [
                "onnxruntime"
            ],
            "baseline": "..."
        }
    ]
}

@luncliff luncliff self-assigned this Jun 27, 2024
* run flatc for test schema
* use FULL_PROTOBUF option for tml.proto
* update baseline
@luncliff luncliff added ci: Azure Pipelines Azure Pipelines (CI) configuration changes ci: CircleCI CircleCI (CI) configuration changes ci: GitHub Actions GitHub Actions (CI) configuration changes update: multiple ports Multiple ports are updated in this Pull Request labels Jun 27, 2024
@luncliff luncliff merged commit 18e264d into main Jun 29, 2024
14 of 22 checks passed
@luncliff luncliff deleted the port/onnxruntime branch June 30, 2024 11:57
luncliff added a commit to luncliff/vcpkg that referenced this pull request Jul 5, 2024
* Based on luncliff/vcpkg-registry#215
  Install CMake configuration for static build
* Remove all features to make things simple...
luncliff added a commit to luncliff/vcpkg that referenced this pull request Jul 6, 2024
* Based on luncliff/vcpkg-registry#215
  Install CMake configuration for static build
* Remove all features to make things simple...
snnn pushed a commit to microsoft/onnxruntime that referenced this pull request Sep 10, 2024
### Changes

1. CMake option `onnxruntime_USE_VCPKG`. It will be used in the vcpkg
port
* Unit test may fail because this option leads to a mixture of
unexpected external library versions.
     Especially ONNX, Protobuf, and Flatbuffers version can be different
2. Overhaul of `onnxruntime_external_deps.cmake`
   * Make `FetchContent_Declare` to try `find_package`.  
See
https://cmake.org/cmake/help/latest/guide/using-dependencies/index.html
* Relocated `FetchContent_Declare` and `FetchContent_MakeAvailable`(or
`onnxruntime_fetchcontent_makeavailable`) to closer lines.
It was too hard to navigate the entire file to search related
sections...
* Alias `IMPORTED` targets like build targets (e.g. `ONNX::onnx` -->
`onnx`)

```cmake
# The script uses `find_package` with the changes.
# In this case, use vcpkg to search dependencies
# See https://cmake.org/cmake/help/latest/guide/using-dependencies/index.html
include(external/onnxruntime_external_deps.cmake)
```

3. Create CMakePresets.json and presets to [run vcpkg in manifest
mode](https://learn.microsoft.com/en-us/vcpkg/concepts/manifest-mode)
   * Currently, it's NOT for training build
   * Main triplets are `x64-windows` and `x64-osx`

```pwsh
Push-Location "cmake"
    cmake --preset "x64-windows-vcpkg"
    cmake --build --preset "x64-windows-vcpkg-debug"
Pop-Location
```
```bash
pushd "cmake"
    cmake --preset "x64-osx-vcpkg"
    cmake --build --preset "x64-osx-vcpkg-debug"
popd
```

4. Updated tools/ci_build/build.py
* `--use_vcpkg` option: it needs `CMAKE_TOOLCHAIN_FILE` with
[vcpkg.cmake toolchain
script](https://github.com/microsoft/vcpkg/blob/master/scripts/buildsystems/vcpkg.cmake)
* `--compile_no_warning_as_error` is recommended because library version
differences will cause unexpected compiler warnings

```bash
python ./tools/ci_build/build.py \
    --compile_no_warning_as_error \
    --use_vcpkg \
    --cmake_extra_defines "CMAKE_TOOLCHAIN_FILE:FILEPATH=${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" \
    --cmake_extra_defines "VCPKG_TARGET_TRIPLET=..."
```

5. Created Job `Vcpkg` for Windows and macOS
   * Show how to setup and use vcpkg.  
     Similar to the CMakePresets.json usage

### Motivation and Context

* Help #7150
* Help microsoft/vcpkg#36850
   * luncliff/vcpkg-registry#212
   * microsoft/vcpkg#39881
* luncliff/vcpkg-registry#215
   * luncliff/vcpkg-registry#216
   * luncliff/vcpkg-registry#227
*
https://cmake.org/cmake/help/latest/guide/using-dependencies/index.html
*
https://github.com/microsoft/vcpkg/blob/master/scripts/buildsystems/vcpkg.cmake

### Future Works?

More feature coverage with the vcpkg supported libraries

* CUDA feature support
* Training feature support
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci: Azure Pipelines Azure Pipelines (CI) configuration changes ci: CircleCI CircleCI (CI) configuration changes ci: GitHub Actions GitHub Actions (CI) configuration changes update: multiple ports Multiple ports are updated in this Pull Request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant